Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pipectl migrate with get then set at pipectl side #5506

Merged
merged 4 commits into from
Jan 23, 2025

Conversation

Warashi
Copy link
Contributor

@Warashi Warashi commented Jan 22, 2025

What this PR does:

This PR modifies the pipectl migrate database command to get the platformProvider and set the deployTargets on client-side operation, not server-side operation.

Why we need it:

The current implementation needs to change when we have a use case that needs to migrate data again, but changing the behavior of the existing RPC is not a good option.
The pipectl side can be considered a script to migrate, and it's not bad to change behavior depending on versions. So I moved the operation to the pipectl side.

Which issue(s) this PR fixes:

Part of #5252

Does this PR introduce a user-facing change?: No

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 0% with 39 lines in your changes missing coverage. Please review.

Project coverage is 26.27%. Comparing base (eac110a) to head (f6dc5f7).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
pkg/app/pipectl/cmd/migrate/database.go 0.00% 21 Missing ⚠️
pkg/app/server/grpcapi/api.go 0.00% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5506      +/-   ##
==========================================
- Coverage   26.29%   26.27%   -0.02%     
==========================================
  Files         464      464              
  Lines       49626    49635       +9     
==========================================
- Hits        13047    13043       -4     
- Misses      35546    35558      +12     
- Partials     1033     1034       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Warashi Warashi marked this pull request as ready for review January 22, 2025 04:52
@Warashi
Copy link
Contributor Author

Warashi commented Jan 22, 2025

I tested on local, and got the output below.

$ pipectl migrate database \
    --insecure=${PIPECD_INSECURE} \
    --address=${PIPECD_HOST} \
    --api-key=${PIPECD_API_KEY} \
    --applications e5e04527-06fd-4b80-850e-6fa4442e530a
migrating database      {"application": "e5e04527-06fd-4b80-850e-6fa4442e530a"}
successfully migrated database  {"application": "e5e04527-06fd-4b80-850e-6fa4442e530a"}

$ pipectl migrate database \
    --insecure=${PIPECD_INSECURE} \
    --address=${PIPECD_HOST} \
    --api-key=${PIPECD_API_KEY} \
    --applications e5e04527-06fd-4b80-850e-6fa4442e530a
migrating database      {"application": "e5e04527-06fd-4b80-850e-6fa4442e530a"}
skip migrating database because the deploy target is already set        {"application": "e5e04527-06fd-4b80-850e-6fa4442e530a"}
successfully migrated database  {"application": "e5e04527-06fd-4b80-850e-6fa4442e530a"}

Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

Please link a task management Issue for this PR later.

@Warashi Warashi merged commit cc28c03 into master Jan 23, 2025
16 of 18 checks passed
@Warashi Warashi deleted the pipecd-data-migration-another-way branch January 23, 2025 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants